﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GSI.Core
{
	/// <summary>
	/// 网格
	/// </summary>
	class MeshData : DataGroup
	{
		/// <summary>
		/// 标记是否经过插值
		/// </summary>
		public bool Interpolated { get; set; }

		/// <summary>
		/// X方向的网格个数
		/// </summary>
		public int CellXNum { set; get; }
		/// <summary>
		/// Y方向的网格个数
		/// </summary>
		public int CellYNum { set; get; }
		/// <summary>
		/// 单个网格的尺寸
		/// </summary>
		public double CellSize { set; get; }
		public GPoint[,] pointsArray { get { return ToArray(); } }

		private GPoint[,] ToArray()

		{
			var array = new GPoint [CellXNum + 1,CellYNum+1];
			var k = 0;
				for (int j = 0; j <= CellYNum; j++)
			for (int i = 0; i <= CellXNum; i++)
				{
					array[i, j] = Points.ElementAt(k);
					k++;
				}
			return array;
		}
	}
}
